package com.lei.yohuo001java.model;

import com.lei.mvp_retrofitlibrary.http.api.API;
import com.lei.mvp_retrofitlibrary.http.bean.GoodsBean;
import com.lei.mvp_retrofitlibrary.http.bean.LoginBean;
import com.lei.mvp_retrofitlibrary.http.bean.RegisterBean;
import com.lei.mvp_retrofitlibrary.http.factory.BaseRetrofitFactory;
import com.lei.yohuo001java.contract.ShopContract;

import java.util.HashMap;

import io.reactivex.Observable;
import okhttp3.RequestBody;

/**
 * @ProjectName : YoHuo001Java
 * @Author : 雷金泷
 * @Time : 2020/12/17 9:28
 * @Description : 文件描述
 */
public class ShopModel implements ShopContract.Model {
    @Override
    public Observable<GoodsBean> initshop(HashMap<String,String> map) {
        return BaseRetrofitFactory.create(API.class).goods(map);
    }

    @Override
    public Observable<RegisterBean> initregister(RequestBody requestBody) {
        return BaseRetrofitFactory.create(API.class).register(requestBody);
    }

    @Override
    public Observable<LoginBean> initlogin(RequestBody requestBody) {
        return BaseRetrofitFactory.create(API.class).login(requestBody);
    }

    @Override
    public void destroy() {

    }
}
